package com.atguigu.bean;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @Author zhaoshuo
 * @ClassName User
 * @Description
 */
@Data
@Document(indexName = "user", shards = 3, replicas = 2)
public class User {
    @Id
    private String id;
    @Field(name = "name", type = FieldType.Text, analyzer = "ik_max_word")
    private String name;
    @Field(name = "age", type = FieldType.Integer)
    private Integer age;
    @Field(name = "salary", type = FieldType.Double)
    private Double salary;
    @Field(name = "birthday", type = FieldType.Date, format = DateFormat.date)
    private Date birthday;


}